package com.dy.lock.screen.service.impl;

import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.UUID;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.dy.lock.screen.dao.CustomerAttentionDao;
import com.dy.lock.screen.pojo.CustomerAttentionInfo;
import com.dy.lock.screen.service.CustomerAttentionService;

@Service("customerAttentionService")
public class CustomerAttentionServiceImpl implements CustomerAttentionService {

	@Resource(name = "customerAttentionDao")
	private CustomerAttentionDao customerAttentionDao;

	@Override
	public CustomerAttentionInfo queryByPrimaryKey(String id) {
		return this.customerAttentionDao.queryByPrimaryKey(id);

	}

	@Override
	public Integer queryCount(Map<String, Object> para) {
		return this.customerAttentionDao.queryCount(para);
	}

	@Override
	public int save(CustomerAttentionInfo attInfo) {
		attInfo.setId(UUID.randomUUID().toString());
		attInfo.setAttentionTime(new Date());
		int re = this.customerAttentionDao.insert(attInfo);
		return re;
	}

	@Override
	public int delete(CustomerAttentionInfo attInfo) {
		int re = this.customerAttentionDao.delete(attInfo);
		return re;
	}

	@Override
	public CustomerAttentionInfo queryByAidAndBeid(
			CustomerAttentionInfo attentionInfo) {
		// TODO Auto-generated method stub
		return this.customerAttentionDao.queryByAidAndBeid(attentionInfo);
	}

	@Override
	public List<String> queryByAidOrBeid(
			CustomerAttentionInfo attentionIdOrBeConcernId) {
		// TODO Auto-generated method stub
		return this.customerAttentionDao
				.queryByAidOrBeid(attentionIdOrBeConcernId);
	}

	@Override
	public List<CustomerAttentionInfo> queryPage(Map<String, Object> para) {
		// TODO Auto-generated method stub
		return this.customerAttentionDao.queryT(para);
	}

}
